﻿@model Tee

@{
    ViewBag.Title = "Redigér tee";
}

<div class="page-header">
    <h1><span class="glyphicon glyphicon-flag"></span> @ViewBag.Title</h1>
</div>
    
@if (!ViewData.ModelState.IsValid)
{
<div class="alert alert-danger alert-dismissable">
    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
    @Html.ValidationSummary("", new { @style = "color: #fff;" })
</div>
}

@using (Html.BeginForm("Edit", "Tee", FormMethod.Post, new { role = "form", @class = "form-horizontal" }))
{
    <div class="form-group">
        <label for="CourseId" class="col-sm-2 col-lg-1 control-label">klub/bane</label>
        <div class="col-sm-6">
            <div class="input-group">
                <span class="input-group-addon"><span class="glyphicon glyphicon-globe"></span></span>
                <input type="text" id="CourseName" name="CourseName" class="form-control" required value="@Model.Course.Name" readonly>
                @*@Html.DropDownListFor(m => m.CourseId, new SelectList(ViewBag.Courses, "Id", "Name"), new { @class = "form-control" })*@
            </div>
        </div>
    </div>
    <div class="form-group">
        <label for="Gender" class="col-sm-2 col-lg-1 control-label">m/k</label>
        <div class="col-sm-6">
            <div class="input-group">
                <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
                @Html.DropDownListFor(m => m.Gender, new SelectList(ViewBag.Genders), new { @class = "form-control" })
            </div>
        </div>
    </div>
    <div class="form-group">
        <label for="Name" class="col-sm-2 col-lg-1 control-label">navn</label>
        <div class="col-sm-6">
            <input type="text" id="Name" name="Name" class="form-control" required placeholder="f.eks. Hvid, Gul eller Rød" value="@Model.Name">
        </div>
    </div>
    <div class="form-group">
        <label for="Description" class="col-sm-2 col-lg-1 control-label">sløjfe/bane</label>
        <div class="col-sm-6">
            <input type="text" id="Description" name="Description" class="form-control" placeholder="f.eks. Skovbanen (kan efterlades blank)" value="@Model.Description">
        </div>
    </div>
    <div class="form-group">
        <label for="IsActive" class="col-sm-2 col-lg-1 control-label">aktiv?</label>
        <div class="col-sm-9">
            @Html.CheckBoxFor(model => model.IsActive)
        </div>
    </div>

    <hr />
    <div class="form-group">
        <label for="CR" class="col-sm-2 col-lg-1 control-label">cr</label>
        <div class="col-sm-2">
            <input type="text" id="CR" name="CR" class="form-control" value="@Model.CR">
        </div>
    </div>
    <div class="form-group">
        <label for="Slope" class="col-sm-2 col-lg-1 control-label">slope</label>
        <div class="col-sm-2">
            <input type="text" id="Slope" name="Slope" class="form-control" value="@Model.Slope">
        </div>
    </div>
    <hr />
    
    
    /* PAR */
    <div class="form-group">
        <label class="col-sm-2 col-md-2 control-label">Par UD</label>
        @for (int n = 1; n < 10; n++)
        {
            <div class="col-sm-10 col-sm-offset-2 col-md-1 col-md-offset-0">
                <input type="number" min="3" max="6" step="1" required name="@string.Concat("par", n)" id="@string.Concat("par", n)" class="form-control" placeholder="@n" value="@Model.GetPar(n)">
            </div>
        }
    </div>
    <div class="form-group">
        <label class="col-sm-5 col-md-2 control-label">Par IND</label>
        @for (int n = 10; n < 19; n++)
        {
            <div class="col-sm-8 col-sm-offset-2 col-md-1 col-md-offset-0">
                <input type="number" min="3" max="6" step="1" required name="@string.Concat("par", n)" id="@string.Concat("par", n)" class="form-control" placeholder="@n" value="@Model.GetPar(n)">
            </div>
        }
    </div>
    <hr />
    
    /* INDEX */
    <div class="form-group">
        <label class="col-sm-5 col-md-2 control-label">Index UD</label>
        @for (int n = 1; n < 10; n++)
        {
            <div class="col-sm-8 col-md-1">
                <input type="number" min="1" max="18" step="1" required name="@string.Concat("Idx", n)" id="@string.Concat("Idx", n)" class="form-control" placeholder="@n" value="@Model.GetIdx(n)">
            </div>
        }
    </div>
    
    <div class="form-group">
        <label class="col-sm-5 col-md-2 control-label">Index IND</label>
        @for (int n = 10; n < 19; n++)
        {
            <div class="col-sm-8 col-md-1">
                <input type="number" min="1" max="18" step="1" required name="@string.Concat("Idx", n)" id="@string.Concat("Idx", n)" class="form-control" placeholder="@n" value="@Model.GetIdx(n)">
            </div>
        }
    </div>
    <hr />
    
    /* METER */
    <div class="form-group">
        <label class="col-sm-5 col-md-2 control-label">meter ud</label>
        @for (int n = 1; n < 10; n++)
        {
        <div class="col-xs-1">
            <input type="number" min="1" max="700" step="1" name="@string.Concat("L", n)" id="@string.Concat("L", n)" class="form-control" placeholder="@n" value="@Model.GetLength(n)">
        </div>
        }
    </div>
    <div class="form-group">
        <label class="col-sm-5 col-md-2 control-label">meter ind</label>
        @for (int n = 10; n < 19; n++)
        {
        <div class="col-xs-1">
            <input type="number" min="1" max="700" step="1" name="@string.Concat("L", n)" id="@string.Concat("L", n)" class="form-control" placeholder="@n" value="@Model.GetLength(n)">
        </div>
        }
    </div>

    <div class="form-group">
        <label for="create" class="col-sm-5 col-md-2 control-label"></label>
        <div class="col-sm-6">
            <button type="submit" class="btn btn-default">gem</button>
            
            @*@Html.ActionLink("slet", "Delete", new { id = Model.Id }, new { @class = "btn btn-danger" })*@
        </div>
    </div>
}
